From: Jan Beulich Date: Mon, 31 Oct 2022 12:26:08 +0000 (+0100) Subject: x86: also zap secondary time area handles during soft reset X-Git-Tag: archive/raspbian/4.16.2+90-g0d39a6d1ae-1+rpi1^2~28^2~52 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=aac108509055e5f5ff293e1fb44614f96a0996c6;p=xen.git x86: also zap secondary time area handles during soft reset Just like domain_soft_reset() properly zaps runstate area handles, the secondary time area ones also need discarding to prevent guest memory corruption once the guest is re-started. Signed-off-by: Jan Beulich Reviewed-by: Roger Pau Monné master commit: b80d4f8d2ea6418e32fb4f20d1304ace6d6566e3 master date: 2022-10-27 11:49:09 +0200 --- diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index a4356893bd..3fab2364be 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -929,6 +929,7 @@ int arch_domain_soft_reset(struct domain *d) struct page_info *page = virt_to_page(d->shared_info), *new_page; int ret = 0; struct domain *owner; + struct vcpu *v; mfn_t mfn; gfn_t gfn; p2m_type_t p2mt; @@ -1008,7 +1009,12 @@ int arch_domain_soft_reset(struct domain *d) "Failed to add a page to replace %pd's shared_info frame %"PRI_gfn"\n", d, gfn_x(gfn)); free_domheap_page(new_page); + goto exit_put_gfn; } + + for_each_vcpu ( d, v ) + set_xen_guest_handle(v->arch.time_info_guest, NULL); + exit_put_gfn: put_gfn(d, gfn_x(gfn)); exit_put_page: